package io.wdb.wxapp.model;

import java.io.Serializable;
import java.util.Date;
import java.util.ArrayList;
import java.util.List;

import io.swagger.annotations.ApiModelProperty;

import io.wdb.modules.activity.wxapp.entity.HdReadActivityEntity;


/**
 * 
 * 
 * @author wdb
 * @email xulin@wdb007.com
 * @date 2018-01-20 15:11:02
 */
public class HdReadActivityModel implements Serializable {
	private static final long serialVersionUID = 1L;
	
	@ApiModelProperty(value = "", required = true)
	private String id;
	@ApiModelProperty(value = "群聊标示符", required = true)
	private String wxGroupId;
	@ApiModelProperty(value = "群组名称", required = true)
	private String wxGroupName;
	@ApiModelProperty(value = "pk时间", required = true)
	private Date createTime;
	@ApiModelProperty(value = "", required = true)
	private String activityId;
	@ApiModelProperty(value = "", required = true)
	private String userId;

	/**
	 * 设置：
	 */
	public void setId(String id) {
		this.id = id;
	}
	/**
	 * 获取：
	 */
	public String getId() {
		return id;
	}
	/**
	 * 设置：群聊标示符
	 */
	public void setWxGroupId(String wxGroupId) {
		this.wxGroupId = wxGroupId;
	}
	/**
	 * 获取：群聊标示符
	 */
	public String getWxGroupId() {
		return wxGroupId;
	}
	/**
	 * 设置：群组名称
	 */
	public void setWxGroupName(String wxGroupName) {
		this.wxGroupName = wxGroupName;
	}
	/**
	 * 获取：群组名称
	 */
	public String getWxGroupName() {
		return wxGroupName;
	}
	/**
	 * 设置：pk时间
	 */
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	/**
	 * 获取：pk时间
	 */
	public Date getCreateTime() {
		return createTime;
	}
	/**
	 * 设置：
	 */
	public void setActivityId(String activityId) {
		this.activityId = activityId;
	}
	/**
	 * 获取：
	 */
	public String getActivityId() {
		return activityId;
	}
	/**
	 * 设置：
	 */
	public void setUserId(String userId) {
		this.userId = userId;
	}
	/**
	 * 获取：
	 */
	public String getUserId() {
		return userId;
	}

    public static HdReadActivityModel convert(HdReadActivityEntity entity) {
		if(entity == null) {
			return null;
		}
		HdReadActivityModel model = new HdReadActivityModel();
				model.setId(entity.getId());
				model.setWxGroupId(entity.getWxGroupId());
				model.setWxGroupName(entity.getWxGroupName());
				model.setCreateTime(entity.getCreateTime());
				model.setActivityId(entity.getActivityId());
				model.setUserId(entity.getUserId());
				
		return model;
	}
	public static List<HdReadActivityModel> convert(List<HdReadActivityEntity> entities){
		if(entities == null || entities.isEmpty()) {
			return null;
		}
		List<HdReadActivityModel> models = new ArrayList<>();
		
		for(HdReadActivityEntity entity:entities) {
			models.add(convert(entity));
		}
		
		return models;
	}
	
	public static HdReadActivityEntity convert(HdReadActivityModel model) {
		if(model == null) {
			return null;
		}
		HdReadActivityEntity entity = new HdReadActivityEntity();
				entity.setId(model.getId());
				entity.setWxGroupId(model.getWxGroupId());
				entity.setWxGroupName(model.getWxGroupName());
				entity.setCreateTime(model.getCreateTime());
				entity.setActivityId(model.getActivityId());
				entity.setUserId(model.getUserId());
				
		return entity;
	}

}
